<?
	ob_start();
	session_start();
	if(empty($_SESSION['user_login'])){
		header("Location: index.php");	
		exit();
	}
	
	$nik = $HTTP_GET_VARS['nik'];
	include("../lib/config.php");
	include("../headL.php");
	// get nama dan nik
	$gnik	= mssql_query("SELECT * FROM Karyawan WHERE NIK='$nik'");
	$rnik	= mssql_fetch_array($gnik);
	
?>
 <link rel="stylesheet" type="text/css" href="../style/style.css">
 <br><br>
 <center><b>DOKUMEN PEGAWAI</b><br /></center>
  <table border="0" cellpadding="1" cellspacing="1" width="95%" align="center" >
  	 <tr>
      <td colspan="5">
      <table>
     	<tr>
      	 <td>NIK</td>
      	 <td>:</td>
      	 <td><?=$rnik[NIK]?></td>
     	</tr>
     	<tr>
      	 <td>Nama</td>
      	 <td>:</td>
      	 <td><?=$rnik[Nama]?></td>
     	</tr>     
      </table>
      </td>
     </tr>
	 <tr class="headlist">
	  <td width="10">No.</td>
	  <td width="250">Nama Dokumen</td>
      <td width="250">File</td>
	 </tr>
<?
	$resB	= mssql_query("SELECT ROW_NUMBER() OVER (ORDER BY NIK) AS No, * FROM S_File_Emp WHERE NIK='$nik'",$conn);
	$SqlBCnt = mssql_num_rows($resB);
	if($SqlBCnt > 0){
		while($rowB	= mssql_fetch_array($resB)){
		echo"
		 <tr class=contentlist valign=top>
		  <td align=right>$rowB[No]</td>
		  <td>$rowB[nama_file]</td>
		  <td><a href='../dokumen/$rowB[filenya]'>$rowB[filenya]</a></td>
		 </tr>
		";
		} 
	}
	else{
		echo"<tr class=cell><td align=center colspan=20>--- TIDAK ADA DATA ---</td></tr>";
	}
?>
<table>
<br>
<center>
 <input type="button" value="Tutup" onClick="Javascript:self.close()" class="button">
</center>
<?
echo"</div>
	  </td>
	   </tr>
	    </table>
";
include("../menu.php");
?>
